package demo2;

import com.tedu.InputField;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * Created by Mikazuki on 2025/3/27.
 */
@Data
@Component
@PropertySource(value = "classpath:config.properties", encoding = "utf-8")
public class Student {
    // 生成一个标准学生类
    private String id;

    @InputField(title = "姓名", notNull = true, regex = "^[\\u4e00-\\u9fa5]{2,5}$", regexNotMathTitle = "姓名格式不正确")
    @Value("${demo2.student.name}")
    private String name;
    @InputField
    @Value("${demo2.student.age}")
    private int age;
    @Value("${demo2.student.major}")
    private String major;
    @Value("${demo2.student.gender}")
    private String gender;
    @Value("${demo2.student.grade}")
    private String grade;
    @Value("${demo2.student.school}")
    private String school;
    @Value("${demo2.student.phone}")
    private String phone;
}
